package com.sprint.questai.model.entity;

/**
 * @Author: mayixiang
 * @Date: 2024/6/14 10:11
 * @Description: find chunk id with kb id
 */
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.util.ArrayList;
import java.util.List;
@Data
@Document(indexName = "kbindex")
public class Index {

    @Id
    private String kbid;
    private List<String> chunkIds;
    private String kbName;
    private String userId;
    private String description;
    public Index() {
        chunkIds = new ArrayList<>();
    }
    public void addChunkId(String chunkId) {
        chunkIds.add(chunkId);
    }
    public void removeChunkId(String chunkId) {
        chunkIds.remove(chunkId);
    }
    // 构造
}
